package testsupport;

use Data::Dumper;
use Test::More;
use Text::Lorem;

require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(check_uuid lorem);

sub check_uuid {
    my $file = shift;
    my $line = shift;
    my $uuid = shift;
    my $e = shift;
    # print STDERR Dumper($e);
    if($e) {
	is($e->{'uuid'},$uuid,"uuid at $file:$line expected: ".$e->{'uuid'}."  found: $uuid. error catched: ".$e->{'string'} );
    }
}

sub lorem {
    my $n = shift || 6;
    my $lorem = Text::Lorem->new;
    # Generate a random latin word
    my $text = Text::Lorem->new();
    # Generate a string of text with 5 words
    return $text->words($n);
}


1;
